package com.xp.code.view;

import java.util.List;

import javax.annotation.Resource;

import net.sf.json.JSONArray;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.xp.code.services.IAuthsService;
import com.xp.code.util.XPCodeSession;
import com.xp.code.vo.MenuVO;

/**
 * 
 * @author HAHA
 *
 */
@Controller("authsAction")
@Scope("prototype")
public class AuthsAction extends XPInfoAction{

	private Logger loger=Logger.getLogger(AuthsAction.class);
	@Resource(name="authsService")
	private IAuthsService authsService;
	
	public AuthsAction() {
		
	}

	
	public IAuthsService getAuthsService() {
		return authsService;
	}


	public void setAuthsService(IAuthsService authsService) {
		this.authsService = authsService;
	}


	public String getAuthSInfo()throws Exception{
		loger.warn("getAuthSInfo  in");
		XPCodeSession xpsession=new XPCodeSession();
		List<MenuVO> list=this.authsService.getAuthSInfo(xpsession.getUSERID());
		JSONArray ja=JSONArray.fromObject(list);
		setJsonString(ja.toString());
		return SUCCESS;
	}
}
